<?php
class Client  
{  
    /** 
     * Available Mobile Clients 
     * 
     * @var array 
     */  
    private $_mobileClients = array(  
        "midp",  
        "240x320",  
        "blackberry",  
        "netfront",  
        "nokia",  
        "panasonic",  
        "portalmmm",  
        "sharp",  
        "sie-",  
        "sonyericsson",  
        "symbian",  
        "windows ce",  
        "benq",  
        "mda",  
        "mot-",  
        "opera mini",  
        "philips",  
        "pocket pc",  
        "sagem",  
        "samsung",  
        "sda",  
        "sgh-",  
        "vodafone",  
        "xda",  
        "iphone",  
        "android",
   		"mobile" 
    );  
    private $ipad="ipad";
  
    /** 
     * Check if client is a mobile client 
     * 
     * @param string $userAgent 
     * @return boolean 
     */  
    
    public  function isIpad($userAgent)
    {
    	$userAgent = strtolower($userAgent);  
            if (strstr($userAgent, $this->ipad)) {  
                return true;  
            }  
       
        return false;  
    }
    
    
    
    public function isMobileClient($userAgent)  
    {  
        $userAgent = strtolower($userAgent);  
        foreach($this->_mobileClients as $mobileClient) {  
            if (strstr($userAgent, $mobileClient)) {  
                return true;  
            }  
        }  
        return false;  
    }  
  
}  

?>